package com.harisucici.websocketlib.room;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.harisucici.websocketlib.entities.send.P2PSendHoleEntity;

@Database(entities = {P2PSendHoleEntity.class}, version = 1, exportSchema = false)
public abstract class P2PUnSendDataBase extends RoomDatabase {
    private static P2PUnSendDataBase p2PUnSendDataBase;

    public static synchronized P2PUnSendDataBase getInstance(Context context) {
        if (p2PUnSendDataBase == null) {
            // 构建
            p2PUnSendDataBase = Room.databaseBuilder(
                    context,
                    P2PUnSendDataBase.class,
                    "p2p_msg_unsend").build();
        }
        return p2PUnSendDataBase;
    }

    public abstract P2PUnSendDao p2PUnSendDao();
}
